domU. The problem is that some code wrongly treat dom.max_memkb as in
byte unit, instead of KB unit. This patch fixs the problem.
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
info->ssidref = op.u.getdomaininfo.ssidref;
info->nr_pages = op.u.getdomaininfo.tot_pages;
- info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT);
+ info->max_memkb = op.u.getdomaininfo.max_pages << (PAGE_SHIFT - 10);
info->shared_info_frame = op.u.getdomaininfo.shared_info_frame;
info->cpu_time = op.u.getdomaininfo.cpu_time;
info->vcpus = op.u.getdomaininfo.n_vcpu;
goto out;
}
- nr_pfns = info.max_memkb >> PAGE_SHIFT;
+ nr_pfns = info.max_memkb >> (PAGE_SHIFT - 10);
/* cheesy sanity check */
- if ( nr_pfns > 1024*1024 ){
+ if ( nr_pfns > 1024*1024 )
+ {
ERR("Invalid state record -- pfn count out of range: %lu", nr_pfns);
goto out;
}
-
/* Map the shared info frame */
live_shinfo = xc_map_foreign_range(xc_handle, dom,
PAGE_SIZE, PROT_READ,